package com.mak001.lite.multiSkill.GUI.Tabs;

import java.awt.Dimension;
import java.awt.Insets;
import java.awt.Rectangle;

import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;

public class AlcherTab extends JPanel {
	private static final long serialVersionUID = 1L;
	
	private JTextField textField7;
	private JTextField itemAlchID;

	public AlcherTab() {
		textField7 = new JTextField();
		itemAlchID = new JTextField();
		this.setLayout(null);

		// ---- textField7 ----
		textField7.setText("Item ID to Alch");
		textField7.setEditable(false);
		textField7.setHorizontalAlignment(SwingConstants.CENTER);
		this.add(textField7);
		textField7
				.setBounds(115, 35, 140, textField7.getPreferredSize().height);

		// ---- itemAlchID ----
		itemAlchID.setText("ID");
		this.add(itemAlchID);
		itemAlchID
				.setBounds(115, 60, 140, itemAlchID.getPreferredSize().height);

		{ // compute preferred size
			Dimension preferredSize = new Dimension();
			for (int i = 0; i < this.getComponentCount(); i++) {
				Rectangle bounds = this.getComponent(i).getBounds();
				preferredSize.width = Math.max(bounds.x + bounds.width,
						preferredSize.width);
				preferredSize.height = Math.max(bounds.y + bounds.height,
						preferredSize.height);
			}
			Insets insets = this.getInsets();
			preferredSize.width += insets.right;
			preferredSize.height += insets.bottom;
			this.setMinimumSize(preferredSize);
			this.setPreferredSize(preferredSize);
		}
	}

	public String getItem() {
		return itemAlchID.getText();
	}

}
